import request from '../index';

const baseUrl = '/base-server';
const baseUrl1 = 'api/base-server';


export const URL_QUERYEQUIPMENTBRAND = `${baseUrl}/equipment/pageQueryEquipmentBrand`;
export const URL_QUERYEQUIPMENTMODEL = `${baseUrl}/equipment/pageQueryEquipmentModel`;
// 分页查询电桩品牌
export const pageQueryEquipmentBrand = (params: any, pages: any) => {
  return request({
    url: `${baseUrl}/equipment/pageQueryEquipmentBrand`,
    params: { form: params, pages: pages },
  });
};
// 新增电桩品牌
export const addEquipmentBrand = (params: any) => {
  return request({
    url: `${baseUrl}/equipment/addEquipmentBrand`,
    params: { form: params, successMsg: '1' },
  });
};
// 更新电桩品牌
export const updateEquipmentBrand = (params: any) => {
  return request({
    url: `${baseUrl}/equipment/updateEquipmentBrand`,
    params: { form: params, successMsg: '1' },
  });
};

export const queryAllEquipmentBrand = (params: any) => {
  return request({
    url: `${baseUrl}/equipment/queryAllEquipmentBrand`,
    params: { form: params },
  });
};

// 分页查询电桩型号
export const pageQueryEquipmentModel = (params: any, pages: any) => {
  return request({
    url: `${baseUrl}/equipment/pageQueryEquipmentModel`,
    params: { form: params, pages: pages },
  });
};

// 新增电桩型号
export const addEquipmentModel = (params: any) => {
  return request({
    url: `${baseUrl}/equipment/addEquipmentModel`,
    params: { form: params, successMsg: '1' },
  });
};

// 更新电桩型号
export const updateEquipmentModel = (params: any) => {
  return request({
    url: `${baseUrl}/equipment/updateEquipmentModel`,
    params: { form: params, successMsg: '1' },
  });
};

// 电桩型号详情
export const queryEquipmentModel = (params: any) => {
  return request({
    url: `${baseUrl}/equipment/queryEquipmentModel`,
    params: { form: params },
  });
};

// 删除电桩型号
export const delEquipmentModel = (params: any) => {
  return request({
    url: `${baseUrl}/equipment/delEquipmentModel`,
    params: { form: params, successMsg: '2' },
  });
};

// 查询等级信息列表
export const URL_QUERYLEVELLIST = `${baseUrl}/level/queryLevelList`;
export const queryLevelList = (params: any, pages: any) => {
  return request({
    url: `${baseUrl}/level/queryLevelList`,
    params: { form: params, pages: pages },
  });
};

// 新增等级
export const addLevel = (params: any) => {
  return request({
    url: `${baseUrl}/level/addLevel`,
    params: { form: params, successMsg: '1' },
  });
};

// 修改等级
export const updateLevel = (params: any) => {
  return request({
    url: `${baseUrl}/level/updateLevel`,
    params: { form: params, successMsg: '1' },
  });
};

// 等级详情
export const queryLevelDetail = (params: any) => {
  return request({
    url: `${baseUrl}/level/queryLevelDetail`,
    params: { form: params },
  });
};

// 删除等级
export const deleteLevel = (params: any) => {
  return request({
    url: `${baseUrl}/level/deleteLevel`,
    params: { form: params, successMsg: '2' },
  });
};

// 导出企业账户流水
export const EXPORT_USERLEVEL = `${baseUrl}/level/exportUserLevel`;



// 查询系统配置—参数配置
export const querySystemSettingsParameter = (params: any) => {
  return request({
    url: `${baseUrl}/systemSettings/querySystemSettingsParameter`,
    params: { form: params },
  });
};

// 新增/修改系统配置—参数配置
export const saveOrUpdateSystemSettingsParameter = (params: any) => {
  return request({
    url: `${baseUrl}/systemSettings/saveOrUpdateSystemSettingsParameter`,
    params: { form: params, successMsg: '2' },
  });
};

// 查询系统配置—财务配置
export const querySystemSettingsFinance = (params: any) => {
  return request({
    url: `${baseUrl}/systemSettings/querySystemSettingsFinance`,
    params: { form: params },
  });
};

// 新增/修改系统配置—财务配置
export const addOrUpdateSystemSettingsFinance = (params: any) => {
  return request({
    url: `${baseUrl}/systemSettings/addOrUpdateSystemSettingsFinance`,
    params: { form: params, successMsg: '2' },
  });
};

// 查询系统配置—短信配置
export const querySystemSettingsSms = (params: any) => {
  return request({
    url: `${baseUrl}/systemSettings/querySystemSettingsSms`,
    params: { form: params },
  });
};

// 新增/修改系统配置—短信配置
export const addOrUpdateSystemSettingsSms = (params: any) => {
  return request({
    url: `${baseUrl}/systemSettings/addOrUpdateSystemSettingsSms`,
    params: { form: params, successMsg: '2' },
  });
};

// 分页查询FTP
export const URL_PAGINGFTP = `${baseUrl}/ftp/pagingFtp`;

// 新增FTP
export const addFtp = (params: any) => {
  return request({
    url: `${baseUrl}/ftp/addFtp`,
    params: { form: params, successMsg: '2' },
  });
};

// 修改FTP
export const updateFtp = (params: any) => {
  return request({
    url: `${baseUrl}/ftp/updateFtp`,
    params: { form: params, successMsg: '2' },
  });
};

// FTP详情
export const getByIdFtp = (params: any) => {
  return request({
    url: `${baseUrl}/ftp/getById`,
    params: { form: params },
  });
};

// 上传ftp固件
export const ftpUpload = (params: any) => {
  return request({
    url: `${baseUrl1}/ftp/ftpUpload`,
    params: { form: params, type: 'import' },
  });
};
